package cn.zwx.member.svc.fallback;

import cn.zwx.member.svc.facade.MemberServiceApi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author zhangwenxue
 */
@Component
public class MemberApiFallback implements FallbackFactory<MemberServiceApi> {
    private static final Logger logger = LoggerFactory.getLogger(MemberApiFallback.class);
    @Override
    public MemberServiceApi create(Throwable cause) {
        return new MemberServiceApi() {
            @Override
            public MemberApiFallback create(Throwable cause) {
                logger.error("调用Member-Service fallback",cause);
                return null;
            }

        };
    }
}
